/* 监控工具类 */
MUtil = {
	/* 获取对象，添加前缀与后缀 */	
	getObject:function(obj,preL,preR){
		
	   var ret = "";
	   
	   if(preL == undefined){
		   preL = "";
	   }
	   if(preR == undefined){
		   preR = "";
	   }
	   
	   for( var p in obj ){
		   
		   //方法不执行操作
		   if(typeof(obj[p]) == "function"){
			   ret += "temp = "+preR + p + ";";
			   ret += preL+p+"= temp(e);"; 
		   }
		   //对象，则递归
		   else if(typeof(obj[p]) == "object"){
			   
			   //数组
			   if (typeof(obj[p].length) != "undefined"){
				   
			   }
			   
			   //对象
			   else{
				   var prL = preL + p + ".";
				   var prR = preR + p + ".";
				   ret += this.getObject(obj[p],prL,prR);
			   }
			    
		   }
		   //数组
		   
		   //其他
		   else{
			  ret += preL+p+"="+preR+p+";"; 
		   }
	   }
	   return ret;
	},
	
	/* 获取属性 */
	getProperty:function(obj,pri){
		   var ret = "";
		   
		   if(pri == undefined){
			   pri = "";
		   }
		   
		   for( var p in obj ){
			   
			   //方法不执行操作
			   if(typeof(obj[p]) == "function"){}
			   //对象，则递归
			   else if(typeof(obj[p]) == "object"){
				   
				   //数组
				   if (typeof(obj[p].length) != "undefined"){
					   
				   }
				   
				   //对象
				   else{
					   var pr = pri + p + ".";
					   ret += this.getProperty(obj[p],pr);
				   }
				    
			   }
			   //数组
			   
			   //其他
			   else{
				  ret += pri+p+"="+obj[p]+"\n"; 
			   }
		   }
		   return ret;
	},
	
	/* 获取参数信息 */
	getParemeter:function(param){
		var url = location.search; //获取url中"?"符后的字串
	    var theRequest = new Object();
	    if (url.indexOf("?") != -1) {
	      var str = url.substr(1);
	      strs = str.split("&");
	      for(var i = 0; i < strs.length; i ++) {
	         theRequest[strs[i].split("=")[0]]=unescape(strs[i].split("=")[1]);
	      }
	    }
	    
	    if(theRequest[param] == undefined){
	    	theRequest[param] = "";
	    }
	    
	    return theRequest[param];

	},
	
	/* 获取页面根路径 */
	getRootPath:function(){
		
	    //获取当前网址，如： http://localhost:8083/uimcardprj/share/meun.jsp
	    var curWwwPath=window.document.location.href;
	    //获取主机地址之后的目录，如： uimcardprj/share/meun.jsp
	    var pathName=window.document.location.pathname;
	    var pos=curWwwPath.indexOf(pathName);
	    //获取主机地址，如： http://localhost:8083
	    var localhostPaht=curWwwPath.substring(0,pos);
	    //获取带"/"的项目名，如：/uimcardprj
	    var projectName=pathName.substring(0,pathName.substr(1).indexOf('/')+1);
	    return(localhostPaht+projectName);
		
	},
}